package com.zhanglingfei.yuekaoclient.feign;

import feign.RequestInterceptor;
import feign.RequestTemplate;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Configuration;

import java.util.UUID;

@Slf4j
@Configuration
public class FeignRequestInterceptor implements RequestInterceptor {
    @Override
    public void apply(RequestTemplate requestTemplate) {
        String token = UUID.randomUUID().toString();
        log.info("token:{}",token);
        requestTemplate.header("token", token);
    }
}
